<template>
  <div class="topBack">
    <div class="content">
      <div class="goBack" @click="goBack">
        <i class="fa fa-chevron-left" aria-hidden="true"></i>
      </div>
      <div class="main">
        <slot></slot>
      </div>
      <div class="menu" @click="goMenu">
        <i class="fa fa-ellipsis-h" aria-hidden="true"></i>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data(){
    return{
      flg:false
    }
  },
  methods: {
    goBack() {
      this.$router.go(-1);
    },
    goMenu(){
      this.flg = this.$store.state.loginFig
      console.log(this.flg)
      if(this.flg){
        this.$router.push('user')
      } else {
        this.$router.push('login')
      }
    }
  }
};
</script>

<style lang="less" scoped>
.topBack {
  width: 100%;
  height: 44px;
  position: fixed;
  top: 0;
  z-index: 9;
  background: white;

  .content {
    width: 100%;
    height: 100%;
    line-height: 44px;
    text-align: center;
    display: flex;
    // background: skyblue;
    .goBack,
    .menu {
      width: 40px;

      i {
        font-size: 18px;
      }
    }
    .main {
      flex: 1;
    }
  }
}
</style>